/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.trabalho;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
import java.lang.*;
import java.util.NoSuchElementException;

/**
 *
 * @author Neylton
 */
public class ReadData {

    private Scanner input;
    
    public void openFile() {
        try {
            input = new Scanner(new File("in.txt"));
        } catch (FileNotFoundException e) {
            System.out.println("Erro ao abrir arquivo. " + e.getMessage());
        }
    }
    
    public void readRecords() {
        try {
            while(input.hasNext()) {
                input.nextInt();
            }
        } catch (NoSuchElementException e) {
            System.out.println(e.getMessage());
        }
    }
}
